package com.googlecode.imanager.client.action;

import com.googlecode.imanager.client.Control;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class DisplayAction extends Action {

    private static final long serialVersionUID = 1L;

    private Control target;
    private boolean showTarget;
    
    public DisplayAction(Control target, boolean showTarget) {
        this.target = target;
        this.showTarget = showTarget;
    }

    @Override
    protected void doExecute(Control sender) {
        if (target != null){
            target.setVisible(showTarget);
        }
    }

    public Control getTarget() {
        return target;
    }

    public void setTarget(Control target) {
        this.target = target;
    }

    public boolean isShowTarget() {
        return showTarget;
    }

    public void setShowTarget(boolean showTarget) {
        this.showTarget = showTarget;
    }

}
